<template>
  <div>
    <h2>{{this.msg}}</h2>
    <el-button @click="listAll">testHttp</el-button>
  </div>
</template>

<script>
import api from '../api/api.ts'
export default {
  name: 'httpTest',
  data () {
    return {
      msg: 'aaaaaa'
    }
  },
  methods: {
    listAll () {
      let param = { name: 'longxiaonan', age: 21 }
      api.listAll(param, response => {
          this.$message.success(JSON.stringify(response))
      }, fail => {
        debugger
        this.$message.error(fail.msg || '请求失败')
      })
    }
  }
}
</script>

<style scoped>

</style>
